<?php

namespace App\Http\Controllers;

use App\Models\Admin;
use App\Models\Pay;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;

class LogController extends AdminController
{
   public function  index(Request $request){

       $where=array();

       if (!empty($request->start)){
           $where[]=array("created_at",'>=',$request->start);
       }
       if (!empty($request->end)){
           $where[]=array("created_at",'<=',$request->end);
       }

       $list = DB::table("action_log")->where($where)->orderby("id","desc")->paginate(20);
       $append = array();
       $re = $request->toArray();
       foreach ($re as $key => $value) {
           $append[$key] = $value;
       }
       $list->appends($append);


       return view("log.list",['list'=>$list]);

   }






}
